#ifndef LEETCODE_CN_CPP_JIANZHI_3_H
#define LEETCODE_CN_CPP_JIANZHI_3_H

#include <unordered_set>
#include <vector>

using namespace std;

namespace jianzhi_3
{

class Solution
{
public:
    int findRepeatNumber(vector<int> &nums)
    {
        unordered_set<int> s;
        int res = 0;
        for (auto n : nums)
        {
            if (s.find(n) != s.end())
            {
                res = n;
                break;
            }
            else
            {
                s.insert(n);
            }
        }
        return res;
    }
};

} // namespace jianzhi_3

#endif //LEETCODE_CN_CPP_JIANZHI_3_H
